package com.linksfield.topup.mapper;

import com.linksfield.topup.config.dto.CalculateResultParamVo;
import com.linksfield.topup.config.dto.PageAndSort;
import com.linksfield.topup.entity.common.ServicePlanOrderAutoRenewalRecord;
import com.linksfield.topup.entity.interfaces.autosubmanage.search.request.RequestAutoSubscriptionSearch;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author lm
 * @date 2021/7/2 16:12
 */
@Mapper
public interface AutoSubscriptionMapper {
    /**
     * 按条件遍历出数据表中符合的总条数 ：service_plan_order_auto_renewal_record_t
     *
     * @param request
     * @return
     */
    long searchPageCount(@Param("request") RequestAutoSubscriptionSearch request);

    /**
     * 按条件计算服务总条数，生效条数，失效条数：service_plan_order_auto_renewal_record_t
     *
     * @param request
     * @return
     */
    List<CalculateResultParamVo> calculate(@Param("request") RequestAutoSubscriptionSearch request);

    /**
     * 按条数遍历出所有数据库表中符合的服务列表：service_plan_order_auto_renewal_record_t
     *
     * @param request
     * @param pageHelper
     * @return
     */
    List<ServicePlanOrderAutoRenewalRecord> search(@Param("request") RequestAutoSubscriptionSearch request,
                                                   @Param("pageHelper") PageAndSort pageHelper);

    /**
     * 根据partnerCode查询企业编码对应的企业名称 ：partner_info_t
     *
     * @param partnerCode
     * @return
     */
    String getPartnerName(@Param("partnerCode") String partnerCode);
}
